package com.isoftstone.iot.city.common;

import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Properties;

/** 
 * 获取版本号信息Controller
 * <br> 
 * @author  MaoYuHua
 * @version  [版本号, 2017年8月8日]
 * @see  [相关类/方法]
 * @since  [产品/模块版本]
 */
@RestController
public class VersionController
{
    @Resource(name = "propertiesConfig")
    Properties properties;
    
    @RequestMapping("/version")
    public String getVersion()
    {
        String version = properties.getProperty("sys_version", "");
        JSONObject reulst = new JSONObject();
        reulst.put("version", version);
        return reulst.toJSONString();
    }
}
